<template>
  <div id="index">
    <div class="header">
      <div class="logo l">
        <a href="javascript:;" name="hov_in" title="补充首页链接"><i class="icon-logo-new"></i></a>
        <a href="javascript:;" name="hov_in"><span>管理控制台</span></a>
        <a href="javascript:;" name="hov_in"><span>产品与服务</span><i class="icon-arrow-down"></i></a></div>
      <div class="topbar_info r">
        <a href="javascript:;" name="hov_in"><i class="icon-search"></i><span>搜索</span>

          <div><input type="text" placeholder="搜索"/><a href="javascript:;" class="icon-enter"></a></div>
        </a>
        <a href="javascript:;" name="hov_in" class="information"><span>消息</span><s>5</s>

          <div>
            <i></i>

            <div><span class="l">站内消息通知</span><a href="javascript:;" class="r">消息接收管理</a></div>
            <div>
              <ul>
                <li><a
                  href="javascript:;"><span>企业智能办公产品人脸考勤机/云路由器AP开售，限时0元购！查看详情</span><span>2017-12-12 13:46</span></a>
                </li>
                <li><a
                  href="javascript:;"><span>独享虚机12.12用户回馈！1元抢独享虚机+云栖纪念版T恤！</span><span>2017-12-11 10:10</span></a>
                </li>
                <li><a
                  href="javascript:;"><span>【阿里云双11】短信套餐低至0.026元/条，办公智能1元起，人脸识别等人工智能API一分钱起调用</span><span>2017-11-10 16:11</span></a>
                </li>
                <li><a
                  href="javascript:;"><span>【阿里云双11】48小时云上狂欢节，全线产品折扣，满返优惠同享，击破全年底价</span><span>2017-11-10 00:47</span></a>
                </li>
                <li><a
                  href="javascript:;"><span>【阿里云双11】30余款云产品新购5折起，充值返5%/报名新购满返10%/续费8折，11.10-11.11狂欢两天</span><span>2017-11-03 19:40</span></a>
                </li>
              </ul>
            </div>
            <a href="javascript:;">查看更多</a>
          </div>
        </a>
        <a href="javascript:;" name="hov_in" class="cost"><span>费用</span>

          <div>
            <ul>
              <li>
                <a href="javascript:;">充值</a>
              </li>
              <li>
                <a href="javascript:;">订单</a>
              </li>
              <li>
                <a href="javascript:;">发票</a>
              </li>
              <li>
                <a href="javascript:;">充值</a>
              </li>
              <li>
                <a href="javascript:;">消费记录</a>
              </li>
              <li>
                <a href="javascript:;">续费管理</a>
              </li>
            </ul>
            <div>
              <ul>
                <li>
                  <a href="javascript:;">进入费用中心</a>
                </li>
              </ul>
            </div>
          </div>
        </a>
        <a href="javascript:;" name="hov_in"><span>工单</span>

          <div>
            <ul>
              <li>
                <a href="javascript:;">我的工单</a>
              </li>
              <li>
                <a href="javascript:;">提交工单</a>
              </li>
            </ul>
          </div>
        </a>
        <a href="javascript:;" name="hov_in"><span>备案</span>

          <div>
            <ul>
              <li>
                <a href="javascript:;">备案服务号申请</a>
              </li>
              <li>
                <a href="javascript:;">备案服务号管理</a>
              </li>
              <li>
                <a href="javascript:;">备案专区</a>
              </li>
              <li>
                <a href="javascript:;">ICP备案系统</a>
              </li>
            </ul>
          </div>
        </a>
        <a href="javascript:;" name="hov_in"><span>企业</span>

          <div>
            <ul>
              <li>
                <a href="javascript:;">资源管理</a>
              </li>
              <li>
                <a href="javascript:;">财务管理(原企业云)</a>
              </li>
              <li>
                <a href="javascript:;">人员管理</a>
              </li>
              <li>
                <a href="javascript:;">权限管理</a>
              </li>
              <li>
                <a href="javascript:;">分销平台</a>
              </li>
            </ul>
          </div>
        </a>
        <a href="javascript:;" name="hov_in"><span>支持</span>

          <div>
            <ul>
              <li>
                <a href="javascript:;">帮助与文档</a>
              </li>
              <li>
                <a href="javascript:;">提交建议</a>
              </li>
              <li>
                <a href="javascript:;">论坛</a>
              </li>
              <li>
                <a href="javascript:;">博客</a>
              </li>
            </ul>
          </div>
        </a>
        <a href="javascript:;" name="hov_in" class="user_list"><span>9314*****@qq.com</span>

          <div>
            <ul>
              <li><a href="javascript:;"><i class="icon-topbar-user-info"></i><span>基本资料</span></a></li>
              <li><a href="javascript:;"><i class="icon-topbar-certify"></i><span>实名认证</span></a></li>
              <li><a href="javascript:;"><i class="icon-topbar-secure-setting"></i><span>安全设置</span></a></li>
              <li><a href="javascript:;"><i class="icon-topbar-secure-control"></i><span>安全管控</span></a></li>
              <li><a href="javascript:;"><i class="icon-topbar-ram"></i><span>访问控制</span></a></li>
              <li><a href="javascript:;"><i class="icon-topbar-accesskeys"></i><span>accesskeys</span></a></li>
              <li><a href="javascript:;"><i class="icon-account"></i><span>会员权益</span></a></li>
              <li><a href="javascript:;"><i class="icon-account"></i><span>会员积分</span></a></li>
              <li><a href="javascript:;"><i class="icon-cps"></i><span>云大使管理</span></a></li>
            </ul>
            <a href="javascript:;">退出管理控制台</a>
          </div>
        </a>
        <a href="javascript:;" name="hov_in"><span>简体中文</span>

          <div>
            <ul>
              <li>
                <a href="javascript:;">English</a>
              </li>
            </ul>
          </div>
        </a>
      </div>
    </div>
    <div class="nav">
      <div class="icon-fold" name="off" pitch="off"></div>
      <div>
        <a href="javascript:;" class="sidebar_title"><i
          class="sidebar-title-icon icon-arrow-right"></i><span>云计算基础服务</span></a>

        <div>
          <!--这里路由的跳转链接-->
          <router-link to="/Index/" class="hov" tag="a">
            <!--<a href="javascript:;" class="hov">-->
              <i class="icon-ecs"></i><span>云服务器 ECS1</span>
            <!--</a>-->
            </router-link>
          <a href="javascript:;" class="hov"><i class="icon-ecs"></i><span>云服务器 ECS</span></a>
          <a href="javascript:;" class="hov"><i class="icon-ecs"></i><span>云服务器 ECS</span></a>
          <a href="javascript:;" class="hov"><i class="icon-ecs"></i><span>云服务器 ECS</span></a>
        </div>
      </div>
      <div>
        <a href="javascript:;" class="sidebar_title"><i
          class="sidebar-title-icon icon-arrow-right"></i><span>大数据(数加)</span></a>

        <div>
          <a href="javascript:;" class="hov"><i class="icon-circle"></i><span>数加控制台概览</span></a>
          <a href="javascript:;" class="hov"><i class="icon-circle"></i><span>数加控制台概览</span></a>
          <a href="javascript:;" class="hov"><i class="icon-circle"></i><span>数加控制台概览</span></a>
          <a href="javascript:;" class="hov"><i class="icon-circle"></i><span>数加控制台概览</span></a>
        </div>
      </div>
      <div>
        <a href="javascript:;" class="sidebar_title"><i
          class="sidebar-title-icon icon-arrow-right"></i><span>安全(云盾)</span></a>

        <div>
          <a href="javascript:;" class="hov"><i class="icon-ddos"></i><span>云盾控制台概览</span></a>
          <a href="javascript:;" class="hov"><i class="icon-ddos"></i><span>云盾控制台概览</span></a>
          <a href="javascript:;" class="hov"><i class="icon-ddos"></i><span>云盾控制台概览</span></a>
          <a href="javascript:;" class="hov"><i class="icon-ddos"></i><span>云盾控制台概览</span></a>
        </div>
      </div>
    </div>
    <div class="content">
      <!--这里显示的是展示的界面-->
      <router-view></router-view>
    </div>
  </div>
</template>

<script>
  export default {
    data ()
  {
    return {
      testvalue: ''
    }
  }
  ,
  created:function () {
    document.querySelector('title').innerHTML='首页';
    document.addEventListener("click", function (e) {
      let ev = e || event, iTarget = ev.target || ev.srcElement;
      eventAgency(iTarget, "sidebar_title", function (s) {
        let navDiv = document.querySelectorAll(".nav > div:not(.icon-fold)"), navTit = document.querySelectorAll(".nav .sidebar-title-icon");
        for (let i = 0; i < navDiv.length; i++) {
          navDiv[i].style.height = "40px";
          navTit[i].style.transform = "none";
        }
        if (getComputedStyle(s.childNodes[0])['transform'] == "none") {
          s.childNodes[0].style.transform = "rotate(90deg)";
          s.parentNode.style.height = s.parentNode.childNodes[2].offsetHeight + "px";
        } else {
          s.childNodes[0].style.transform = "none";
          s.parentNode.style.height = "40px";
        }
      });
    })
    setTimeout(function () {
      //内容变化
    }, 10000)
  }
  ,
  mounted:function () {
    let navPitch = document.querySelector(".nav .icon-fold"), navTit = document.querySelectorAll(".nav div a span"), content = document.querySelector("#index > .content");
    navPitch.addEventListener("click", function () {
      if (navPitch.getAttribute("pitch") == "off") {
        this.setAttribute("pitch", "on");
        this.parentNode.style.width = "180px";
        this.setAttribute("name", "on");
        content.style.paddingLeft = "180px";
        for (let i = 0; i < navTit.length; i++) navTit[i].style.display = "inline-block";
      } else {
        this.setAttribute("pitch", "off");
        this.parentNode.style.width = "50px";
        this.setAttribute("name", "off");
        content.style.paddingLeft = "50px";
        for (let i = 0; i < navTit.length; i++) navTit[i].style.display = "none";
      }
    });
    let navTags = document.querySelectorAll(".nav > div:not(.icon-fold) a:not(.sidebar_title)");
    for (let i = 0; i < navTags.length; i++) {
      navTags[i].addEventListener("click", function () {
        for (let j = 0; j < navTags.length; j++) navTags[j].className = "hov"
        this.className = "hov_c";
      })
    }
  }
  }
</script>


<style>

  html {
    padding-left: 50px;
    padding-top: 50px;
  }
  #index {
    width: 100%;
    height: 100%;
    position: relative;
  }

  #index > div {
    height: 100%;
  }

  /*头部*/

  a[name="hov_in"] {
    float: left;
    color: #fff;
    font-size: 14px;
    padding: 0 18px;
    height: 50px;
    line-height: 50px;
    text-align: center;
    margin-right: 1px;
    box-sizing: border-box;
    position: relative;
    background-color: #373d41;
  }

  a[name="hov_in"]:hover {
    background-color: #2a2f32;
  }

  #index > .header {
    height: 50px;
    width: 100%;
    min-width: 1100px;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 2;
    background: #373d41;
  }

  #index > .header > div a:last-child {
    margin-right: 0;
  }

  #index > .header .logo, #index > .header .topbar_info {
    background-color: #333;
  }

  .topbar_info > a > div {
    position: absolute;
    top: 50px;
    right: 0;
    padding: 10px 0;
    display: none;
    background-color: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  }

  .topbar_info > .cost > div div {
    border-top: 1px solid #eaeaea;
    padding-top: 10px;
    margin-top: 10px;
    overflow: hidden;
  }

  .topbar_info > a > div ul {
    padding: 0;
    margin: 0;
  }

  .topbar_info > a > div ul li {
    list-style: none;
    overflow: hidden;
  }

  .topbar_info > a > div ul li:hover {
    background-color: rgb(245, 245, 245);
  }

  .topbar_info > a > div ul li a {
    padding: 0 18px;
    min-width: 140px;
    float: left;
    font-size: 12px;
    color: #333;
    height: 40px;
    line-height: 40px;
    text-align: left;
    box-sizing: border-box;
  }

  .topbar_info > a:hover > div {
    display: block;
  }

  .topbar_info > a:first-child > div {
    box-sizing: border-box;
    height: 38px;
    overflow: hidden;
    border: 2px solid #2a2f32;
    background-color: #fff;
    padding: 4px 6px;
    width: 280px;
  }

  .topbar_info > a:first-child > div > input {
    width: 250px;
    height: 100%;
    max-width: 250px;
    position: absolute;
    left: 0;
    outline: none;
    border: none;
    top: 0;
    color: #546478;
    text-indent: 4px;
    font-size: 12px;
  }

  .topbar_info > a:first-child > div > input::-webkit-input-placeholder {
    color: #546478;
  }

  .topbar_info > a:first-child > div > .icon-enter {
    width: 34px;
    height: 34px;
    position: absolute;
    right: 0;
    top: 0;
    line-height: 34px;
    background-color: #fff;
    color: #546478;
  }

  .icon-search {
    font-size: 16px;
    padding-right: 4px;
  }

  .header .logo a:first-child {
    width: 50px;
    height: 50px;
    font-size: 24px;
    padding: 0;
  }

  .header .logo a {
    padding: 0 20px;
  }

  .header .logo a:nth-of-type(2) {
    width: 128px;
    padding: 0;
  }

  .header .logo a span, .header .logo a i, .header .topbar_info a span, .header .topbar_info a i, .header .topbar_info a s {
    vertical-align: middle;
  }

  .header .topbar_info a s {
    font-size: 12px;
    color: #fff;
    background: #ff9900;
    border-radius: 5px;
    padding: 2px 5px;
    display: inline-block;
    margin-left: 5px;
    line-height: 16px;
  }

  .header .information {
    position: relative;
  }

  .header .information > div {
    position: absolute;
    width: 300px;
    right: 50%;
    margin-right: -150px;
    padding: 0;
    background-color: #eaedf1;
  }

  .header .information > div div:first-of-type {
    height: 50px;
    background-color: #eaedf1;
    padding: 0 15px;
    line-height: 50px;
    color: #333;
    font-size: 14px;
  }

  .header .information > div div:first-of-type span {
    color: #333;
    font-size: 14px;
  }

  .header .information > div div:first-of-type a {
    font-size: 13px;
    color: #00C1DE;
  }

  .header .information > div div:last-of-type ul li {
    border-bottom: 1px solid #eaedf1;
    height: 60px;
  }

  .header .information > div div:last-of-type ul li a {
    display: block;
    height: 100%;
    width: 100%;
    box-sizing: border-box;
    padding: 10px 10px;
    background: #fff;
    line-height: 1.5;
    color: #333;
  }

  .header .information > div div:last-of-type ul li a:hover {
    background-color: #f9f9f9;
  }

  .header .information > div div:last-of-type ul li a span:first-of-type {
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 300px;
    color: #00C1DE;
    display: block;
    padding-right: 10px;
  }

  .header .information > div > i {
    position: absolute;
    top: -12px;
    right: 50%;
    margin-left: -3px;
    border: 6px solid transparent;
    border-bottom: 6px solid #eaedf1;
  }

  .header .information > div > a {
    height: 50px;
    line-height: 50px;
    background: #fff;
    color: #00C1DE;
    text-align: center;
    display: block;
  }

  .header .user_list > div {
    padding: 0;
  }

  .header .user_list > div > a {
    text-align: center;
    transition: all 0.15s;
    color: #333;
    border-top: 1px solid #f5f5f5;
    height: 50px;
    line-height: 50px;
    display: block;
    font-size: 12px;
  }

  .header .user_list > div > a:hover {
    background-color: rgb(245, 245, 245);
  }

  .header .user_list > div ul {
    width: 270px;
    overflow: hidden;
    padding: 10px 15px;
  }

  .header .user_list > div ul li {
    width: 80px;
    height: 80px;
    float: left;
    text-align: center;
    color: #333;
  }

  .header .user_list > div ul li a {
    line-height: 0;
    padding: 0;
    transition: all 0.15s;
    min-width: 0;
    width: 100%;
    height: 100%;
    text-align: center;
    color: #788D9B;
  }

  .header .user_list > div ul li a i {
    font-size: 20px;
    margin: 8px auto 4px;
    width: 40px;
    height: 40px;
    display: block;
    vertical-align: middle;
    line-height: 40px;
    text-align: center;
  }

  .header .user_list > div ul li a span {
    color: #333;
    line-height: 1;
  }

  /*侧拉栏*/

  #index > .nav {
    width: 50px;
    height: 100%;
    position: fixed;
    top: 0;
    left: 0;
    overflow: hidden;
    background-color: #333744;
    padding-top: 50px;
  }

  .nav > div {
    width: 180px;
  }

  .nav .icon-fold {
    width: 100%;
    height: 30px;
    color: #aeb9c2;
    background: #4A5064;
    text-align: center;
    line-height: 30px;
    font-size: 12px;
    cursor: pointer;
  }

  .nav .icon-fold:hover {
    color: #fff;
  }

  .nav > div:not(.icon-fold) {
    overflow: hidden;
    transition: 0.12s;
    position: relative;
  }

  .nav > div:not(.icon-fold) > div {
    position: absolute;
    top: 40px;
    left: 0;
  }

  .nav > div:not(.icon-fold) a {
    color: #fff;
    height: 40px;
    width: 180px;
    line-height: 40px;
    display: block;
    background-color: rgb(66, 72, 91);
  }

  .nav .sidebar_title:hover {
    background-color: rgb(0, 193, 222);
  }

  .nav > div:not(.icon-fold) .hov_c {
    background-color: rgb(0, 193, 222);
  }

  .nav .hov:not(.hov_c) {
    background-color: #333744;
  }

  .nav .hov:not(.hov_c):hover {
    background-color: rgb(74, 80, 100);
  }

  .nav div a i {
    margin: 0 8px 0 20px;
    vertical-align: middle;
    transition: 0.12s;
    float: left;
  }

  .nav div a span {
    display: none;
    vertical-align: middle;
  }

  /*内容*/
  #index > .content {
    overflow: auto;
    padding: 16px;
    box-sizing: border-box;
    background-color: #eaedf1;
    color: #333;
  }
</style>
